import request from '@/utils/request'

export function fetchData(data) {
  return request({
    url: '/role/list',
    method: 'get',
    params: data
  })
}

export function fetchEditData(data) {
  return request({
    url: '/role/menu/get',
    method: 'get',
    params: data
  })
}

export function fetchAdd(data) { // 新建权限
  return request({
    url: '/role/menu/add',
    method: 'post',
    data,
  })
}

export function fetchEdit(data) { // 编辑权限
  return request({
    url: '/role/menu/update',
    method: 'post',
    data
  })
}

export function fetchmenuTree(data) { // 菜单树
  return request({
    url: '/role/menu/list',
    method: 'get',
    params:data
  })
}

export function fetchDel(data) { // 删除权限
  return request({
    url: '/role/delete',
    method: 'get',
    params: data
  })
}

export function fetchProducts() { // 订阅产品接口
  return request({
    url: `/enterprise/getServer`,
    method: 'get',
  })
}
